#!/bin/bash

# 定义要杀掉的进程的路径
PROCESS_PATH="run_qt_rtsp_show_ui"

# 使用 ps 命令查找进程 ID
# PROCESS_ID=$(ps aux | grep "$PROCESS_PATH" | awk '{print $2}')
PROCESS_ID=$(ps -ef | grep "$PROCESS_PATH" | awk 'NR == 1 {print $2}')

# 如果找到了进程 ID，则使用 kill 命令终止进程
if [[ -n "$PROCESS_ID" ]]; then
    echo "Killing process with ID: $PROCESS_ID"
    kill -9 "$PROCESS_ID"
else
    echo "Process not found or unable to kill."
fi
